<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="88px">
      <el-form-item label="原材料编码" prop="rawMaterialCode">
        <el-input
          v-model="queryParams.rawMaterialCode"
          placeholder="请输入原材料编码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="规格型号" prop="specModel">
        <el-input
          v-model="queryParams.specModel"
          placeholder="请输入规格型号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <el-form-item label="产品名称" prop="productName">
        <el-input
          v-model="queryParams.productName"
          placeholder="请输入产品名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="序列号" prop="serialNumber">
        <el-input
          v-model="queryParams.serialNumber"
          placeholder="请输入序列号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="工艺图号" prop="drawingNum">
        <el-input
          v-model="queryParams.drawingNum"
          placeholder="请输入图号或工艺图号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="名称" prop="itemName">
        <el-input
          v-model="queryParams.itemName"
          placeholder="请输入名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['base:techRoute:add']"
        >新增
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['base:techRoute:edit']"
        >修改
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['base:techRoute:remove']"
        >删除
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['base:techRoute:export']"
        >导出
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="info"
          plain
          icon="el-icon-upload2"
          size="mini"
          @click="handleImport"
        >导入
        </el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="techRouteList" @selection-change="handleSelectionChange" max-height="500">
      <el-table-column type="selection" width="55" align="center"/>
      <el-table-column label="公司代码" align="center" prop="gcCode"/>
      <el-table-column label="公司名称" align="center" prop="gcName"/>
      <el-table-column label="产品编号" align="center" prop="cpbh"/>
      <el-table-column label="产品名称" align="center" prop="productName"/>
      <el-table-column label="序列号" align="center" prop="serialNumber" width="160"/>
      <el-table-column label="图号或工艺图号" align="center" prop="drawingNum" width="200"/>
      <el-table-column label="名称" align="center" prop="itemName"/>
      <el-table-column label="所属部装" align="center" prop="belongBz" width="140"/>
      <el-table-column label="部装图号或工艺图号" align="center" prop="bzDrawingNum" width="200"/>
      <el-table-column label="材料" align="center" prop="material"/>
      <el-table-column label="原材料编码" align="center" prop="rawMaterialCode" width="140"/>
      <el-table-column label="物料编码" align="center" prop="itemCode" width="110"/>
      <el-table-column label="线体类别" align="center" prop="lintType" width="120"/>
      <el-table-column label="规格型号" align="center" prop="specModel"/>
      <el-table-column label="加工类型" align="center" prop="processType"/>
      <el-table-column label="本部数量" align="center" prop="bbNum"/>
      <el-table-column label="本台数量" align="center" prop="btNum"/>
      <el-table-column label="工艺路线" align="center" prop="techRoute" width="260"/>
      <el-table-column label="铸造锻造" align="center" prop="zzdz"/>
      <el-table-column label="清理时效" align="center" prop="qlsx"/>
      <el-table-column label="热处理" align="center" prop="rcl"/>
      <el-table-column label="机加工" align="center" prop="jjg"/>
      <el-table-column label="锯床下料" align="center" prop="jcxl"/>
      <el-table-column label="激光切割" align="center" prop="jgqg"/>
      <el-table-column label="火焰切割" align="center" prop="hyqg"/>
      <el-table-column label="打磨清除" align="center" prop="dmqc"/>
      <el-table-column label="修开坡口  " align="center" prop="xkpk"/>
      <el-table-column label="折弯" align="center" prop="zw"/>
      <el-table-column label="冲压" align="center" prop="cy"/>
      <el-table-column label="制弧" align="center" prop="zh"/>
      <el-table-column label="弯曲" align="center" prop="wq"/>
      <el-table-column label="组对组装" align="center" prop="zdzz"/>
      <el-table-column label="焊接" align="center" prop="hj"/>
      <el-table-column label="校正" align="center" prop="xz"/>
      <el-table-column label="打磨" align="center" prop="dm"/>
      <el-table-column label="抛丸" align="center" prop="pw"/>
      <el-table-column label="划线" align="center" prop="hx"/>
      <el-table-column label="镗铣" align="center" prop="tx"/>
      <el-table-column label="车" align="center" prop="che"/>
      <el-table-column label="磨" align="center" prop="mo"/>
      <el-table-column label="钻" align="center" prop="zuan"/>
      <el-table-column label="锪" align="center" prop="hu"/>
      <el-table-column label="铰孔" align="center" prop="jk"/>
      <el-table-column label="攻丝" align="center" prop="gs"/>
      <el-table-column label="插" align="center" prop="cha"/>
      <el-table-column label="线切割" align="center" prop="xqg"/>
      <el-table-column label="部件装配" align="center" prop="bjzp"/>
      <el-table-column label="动平衡" align="center" prop="dph"/>
      <el-table-column label="配电" align="center" prop="pd"/>
      <el-table-column label="总装" align="center" prop="zz"/>
      <el-table-column label="喷漆" align="center" prop="pq"/>
      <el-table-column label="备注" align="center" prop="remark"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['base:techRoute:edit']"
          >修改
          </el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['base:techRoute:remove']"
          >删除
          </el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改工艺路线对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
        <el-row>
          <el-col :span="8">
            <el-form-item label="原材料编码" prop="rawMaterialCode">
              <el-input v-model="form.rawMaterialCode" placeholder="请输入原材料编码"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="规格型号" prop="specModel">
              <el-input v-model="form.specModel" placeholder="请输入规格型号"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="本部数量" prop="bbNum">
              <el-input v-model="form.bbNum" placeholder="请输入本部数量"/>
            </el-form-item>
          </el-col>
        </el-row>


        <el-row>
          <el-col :span="8">
            <el-form-item label="本台数量" prop="btNum">
              <el-input v-model="form.btNum" placeholder="请输入本台数量"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="工艺路线" prop="techRoute">
              <el-input v-model="form.techRoute" placeholder="请输入工艺路线"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="铸造锻造" prop="zzdz">
              <el-input v-model="form.zzdz" placeholder="请输入铸造锻造"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="清理时效" prop="qlsx">
              <el-input v-model="form.qlsx" placeholder="请输入清理时效"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="热处理" prop="rcl">
              <el-input v-model="form.rcl" placeholder="请输入热处理"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="机加工" prop="jjg">
              <el-input v-model="form.jjg" placeholder="请输入机加工"/>
            </el-form-item>
          </el-col>
        </el-row>


        <el-row>
          <el-col :span="8">
            <el-form-item label="产品编号" prop="cpbh">
              <el-input v-model="form.cpbh" placeholder="请输入产品编号"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="锯床下料" prop="jcxl">
              <el-input v-model="form.jcxl" placeholder="请输入锯床下料"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="激光切割" prop="jgqg">
              <el-input v-model="form.jgqg" placeholder="请输入激光切割"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="火焰切割" prop="hyqg">
              <el-input v-model="form.hyqg" placeholder="请输入火焰切割"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="打磨清除" prop="dmqc">
              <el-input v-model="form.dmqc" placeholder="请输入打磨清除"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="修开坡口  " prop="xkpk">
              <el-input v-model="form.xkpk" placeholder="请输入修开坡口  "/>
            </el-form-item>
          </el-col>
        </el-row>



        <el-row>
          <el-col :span="8">
            <el-form-item label="折弯" prop="zw">
              <el-input v-model="form.zw" placeholder="请输入折弯"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="冲压" prop="cy">
              <el-input v-model="form.cy" placeholder="请输入冲压"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="制弧" prop="zh">
              <el-input v-model="form.zh" placeholder="请输入制弧"/>
            </el-form-item>
          </el-col>
        </el-row>


        <el-row>
          <el-col :span="8">
            <el-form-item label="弯曲" prop="wq">
              <el-input v-model="form.wq" placeholder="请输入弯曲"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="组对组装" prop="zdzz">
              <el-input v-model="form.zdzz" placeholder="请输入组对组装"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="产品名称" prop="productName">
              <el-input v-model="form.productName" placeholder="请输入产品名称"/>
            </el-form-item>
          </el-col>
        </el-row>


        <el-row>
          <el-col :span="8">
            <el-form-item label="焊接" prop="hj">
              <el-input v-model="form.hj" placeholder="请输入焊接"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="校正" prop="xz">
              <el-input v-model="form.xz" placeholder="请输入校正"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="打磨" prop="dm">
              <el-input v-model="form.dm" placeholder="请输入打磨"/>
            </el-form-item>
          </el-col>
        </el-row>



        <el-row>
          <el-col :span="8">
            <el-form-item label="抛丸" prop="pw">
              <el-input v-model="form.pw" placeholder="请输入抛丸"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="划线" prop="hx">
              <el-input v-model="form.hx" placeholder="请输入划线"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="镗铣" prop="tx">
              <el-input v-model="form.tx" placeholder="请输入镗铣"/>
            </el-form-item>
          </el-col>
        </el-row>


        <el-row>
          <el-col :span="8">
            <el-form-item label="车" prop="che">
              <el-input v-model="form.che" placeholder="请输入车"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="磨" prop="mo">
              <el-input v-model="form.mo" placeholder="请输入磨"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="钻" prop="zuan">
              <el-input v-model="form.zuan" placeholder="请输入钻"/>
            </el-form-item>
          </el-col>
        </el-row>




        <el-row>
          <el-col :span="8">
            <el-form-item label="锪" prop="hu">
              <el-input v-model="form.hu" placeholder="请输入锪"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="序列号" prop="serialNumber">
              <el-input v-model="form.serialNumber" placeholder="请输入序列号"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="铰孔" prop="jk">
              <el-input v-model="form.jk" placeholder="请输入铰孔"/>
            </el-form-item>
          </el-col>
        </el-row>


        <el-row>
          <el-col :span="8">
            <el-form-item label="攻丝" prop="gs">
              <el-input v-model="form.gs" placeholder="请输入攻丝"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="插" prop="cha">
              <el-input v-model="form.cha" placeholder="请输入插"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="线切割" prop="xqg">
              <el-input v-model="form.xqg" placeholder="请输入线切割"/>
            </el-form-item>
          </el-col>
        </el-row>


        <el-row>
          <el-col :span="8">
            <el-form-item label="部件装配" prop="bjzp">
              <el-input v-model="form.bjzp" placeholder="请输入部件装配"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="动平衡" prop="dph">
              <el-input v-model="form.dph" placeholder="请输入动平衡"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="配电" prop="pd">
              <el-input v-model="form.pd" placeholder="请输入配电"/>
            </el-form-item>
          </el-col>
        </el-row>



        <el-row>
          <el-col :span="8">
            <el-form-item label="总装" prop="zz">
              <el-input v-model="form.zz" placeholder="请输入总装"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="喷漆" prop="pq">
              <el-input v-model="form.pq" placeholder="请输入喷漆"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="备注" prop="remark">
              <el-input v-model="form.remark" placeholder="请输入备注"/>
            </el-form-item>
          </el-col>
        </el-row>


        <el-row>
          <el-col :span="8">
            <el-form-item label="图号" prop="drawingNum">
              <el-input v-model="form.drawingNum" placeholder="请输入图号或工艺图号"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="名称" prop="itemName">
              <el-input v-model="form.itemName" placeholder="请输入名称"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="所属部装" prop="belongBz">
              <el-input v-model="form.belongBz" placeholder="请输入所属部装"/>
            </el-form-item>
          </el-col>
        </el-row>


        <el-row>
          <el-col :span="8">
            <el-form-item label="部装图号" prop="bzDrawingNum">
              <el-input v-model="form.bzDrawingNum" placeholder="请输入部装图号或工艺图号"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="材料" prop="material">
              <el-input v-model="form.material" placeholder="请输入材料"/>
            </el-form-item>
          </el-col>
        </el-row>








      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
      <el-upload
        ref="upload"
        :limit="1"
        accept=".xlsx, .xls"
        :headers="upload.headers"
        :action="upload.url + '?updateSupport=' + upload.updateSupport"
        :disabled="upload.isUploading"
        :on-progress="handleFileUploadProgress"
        :on-success="handleFileSuccess"
        :auto-upload="false"
        drag
      >
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
        <div class="el-upload__tip text-center" slot="tip">
          <!--  <div class="el-upload__tip" slot="tip">
              <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
            </div>-->
          <span>仅允许导入xls、xlsx格式文件。</span>
          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
                   @click="importTemplate">下载模板
          </el-link>
        </div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm">确 定</el-button>
        <el-button @click="upload.open = false">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {listTechRoute, getTechRoute, delTechRoute, addTechRoute, updateTechRoute} from "@/api/base/techRoute";
import {getToken} from "@/utils/auth";

export default {
  name: "TechRoute",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 工艺路线表格数据
      techRouteList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        gcCode: null,
        gcName: null,
        rawMaterialCode: null,
        specModel: null,
        processType: null,
        bbNum: null,
        btNum: null,
        techRoute: null,
        zzdz: null,
        qlsx: null,
        rcl: null,
        jjg: null,
        cpbh: null,
        jcxl: null,
        jgqg: null,
        hyqg: null,
        dmqc: null,
        xkpk: null,
        zw: null,
        cy: null,
        zh: null,
        wq: null,
        zdzz: null,
        productName: null,
        hj: null,
        xz: null,
        dm: null,
        pw: null,
        hx: null,
        tx: null,
        che: null,
        mo: null,
        zuan: null,
        hu: null,
        serialNumber: null,
        jk: null,
        gs: null,
        cha: null,
        xqg: null,
        bjzp: null,
        dph: null,
        pd: null,
        zz: null,
        pq: null,
        drawingNum: null,
        itemName: null,
        belongBz: null,
        bzDrawingNum: null,
        material: null,
      },
      upload: {
        // 是否显示弹出层（物料导入）
        open: false,
        // 弹出层标题（物料导入）
        title: "导入`techRoute`信息",
        // 是否禁用上传
        isUploading: false,
        // 是否更新已经存在的用户数据
        updateSupport: 0,
        // 设置上传的请求头部
        headers: {Authorization: "Bearer " + getToken()},
        // 上传的地址
        url: process.env.VUE_APP_BASE_API + "/base/techRoute/importData"
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {}
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询工艺路线列表 */
    getList() {
      this.loading = true;
      listTechRoute(this.queryParams).then(response => {
        this.techRouteList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        gcCode: null,
        gcName: null,
        rawMaterialCode: null,
        specModel: null,
        processType: null,
        bbNum: null,
        btNum: null,
        techRoute: null,
        zzdz: null,
        qlsx: null,
        rcl: null,
        jjg: null,
        cpbh: null,
        jcxl: null,
        jgqg: null,
        hyqg: null,
        dmqc: null,
        xkpk: null,
        zw: null,
        cy: null,
        zh: null,
        wq: null,
        zdzz: null,
        productName: null,
        hj: null,
        xz: null,
        dm: null,
        pw: null,
        hx: null,
        tx: null,
        che: null,
        mo: null,
        zuan: null,
        hu: null,
        serialNumber: null,
        jk: null,
        gs: null,
        cha: null,
        xqg: null,
        bjzp: null,
        dph: null,
        pd: null,
        zz: null,
        pq: null,
        remark: null,
        drawingNum: null,
        itemName: null,
        belongBz: null,
        bzDrawingNum: null,
        material: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加工艺路线";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getTechRoute(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改工艺路线";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateTechRoute(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addTechRoute(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除工艺路线编号为"' + ids + '"的数据项？').then(function () {
        return delTechRoute(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('base/techRoute/export', {
        ...this.queryParams
      }, `techRoute_${new Date().getTime()}.xlsx`)
    },
    /** 导入按钮操作 */
    handleImport() {
      this.upload.title = "工艺路线导入";
      this.upload.open = true;
    },
    /** 下载模板操作 */
    importTemplate() {
      this.download('base/techRoute/importTemplate', {}, `工艺路线模板.xlsx`)
    },
    // 文件上传中处理
    handleFileUploadProgress(event, file, fileList) {
      this.upload.isUploading = true;
    },
    // 文件上传成功处理
    handleFileSuccess(response, file, fileList) {
      this.upload.open = false;
      this.upload.isUploading = false;
      this.$refs.upload.clearFiles();
      this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", {dangerouslyUseHTMLString: true});
      this.getList();
    },
    // 提交上传文件
    submitFileForm() {
      this.$refs.upload.submit();
    },
  }
};
</script>
